//
//  YKSaleModel.m
//  YunKang
//
//  Created by leoking870 on 2017/11/1.
//  Copyright © 2017年 leoking870. All rights reserved.
//

#import "YKSaleModel.h"

@implementation YKSaleModel
- (NSString *)code {
    if (self.ID) {
        return self.ID;
    }
    return self.GOODS_ID?:self.GUEST_ID;
}
- (NSString *)name {
    if (self.ID) {
        if(self.LINK_PHONE){
                return [NSString stringWithFormat:@"%@|%@",self.USER_NAME,self.LINK_PHONE];
        }
        else {
            return self.USER_NAME;
        }
        
    }
    if (self.GOODS_NAME){
        if(self.GOODS_ID.length){
            return [NSString stringWithFormat:@"%@|%@",self.GOODS_ID,self.GOODS_NAME];
        }
        else {
            return self.GOODS_NAME;
        }
    }
    return self.GUEST_NAME;
}
- (NSArray *)sub {
    return nil;
}
- (NSString *)id_p {
    if (self.ID) {
        return self.ID;
    }
    return self.GOODS_ID?:self.GUEST_ID;
}
@synthesize name;

@synthesize sub;

@synthesize id_p;

@synthesize code;

@end


